<?php

namespace addons\qingdongams\model;

use think\Model;
use traits\model\SoftDelete;

/**
 *工单其他信息表
 */
class WorkorderProgress Extends Model {
    use SoftDelete;

    protected $name  = 'qingdongams_workorder_progress';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';


    public function getCreatetimeAttr($value)
    {
        return date('Y-m-d H:i', $value);
    }

    //创建人
    public function createStaff()
    {
        return $this->hasOne(Staff::class, 'id', 'create_staff_id')->field('id,name');
    }

}
